package com.neuedu.it.mylink.advice;

import com.neuedu.it.mylink.controller.vo.Result;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class ErrControllerAdvice {
    //异常处理
    @ExceptionHandler(Exception.class)
    @ResponseBody
    public Result handleException(Exception e)
    {
        e.printStackTrace();
        return new Result(5000,"服务器异常",e.getMessage());
    }
}
